package cn.liulingfengyu.structuralpattern.facadepattern;

/**
 * 外观类
 */
public class Facade {
    private SubsystemA subsystemA;
    private SubsystemB subsystemB;
    private SubsystemC subsystemC;

    public Facade() {
        this.subsystemA = new SubsystemA();
        this.subsystemB = new SubsystemB();
        this.subsystemC = new SubsystemC();
    }

    /**
     * 外观方法1：封装子系统A和B的操作
     */
    public void operation1() {
        subsystemA.operationA();
        subsystemB.operationB();
    }

    /**
     * 外观方法2：封装子系统B和C的操作
     */
    public void operation2() {
        subsystemB.operationB();
        subsystemC.operationC();
    }
}